
<script src="crypto.js"></script>
<script src="moment.js"></script>
<script>
    var t = {default:CryptoJS}
    var r = {default:moment}
   // console.log(moment())
    var xx = encryptionData({
        method: "POST",
        url: "/front-manager/api/customer/editBaseInfo/token",
        body: "{\"channel\":\"h5\",\"nickname\":\"Sunlonglong1\"}",
        ak: "00670fb03584fbf44dd6b136e534f495",
        sk: "0d65f24dbe2bc1ede3c3ceeb96ef71bb"
    })
    console.log(xx)

     function encryptionData() {
        var e = arguments.length > 0
            && void 0 !== arguments[0] ? arguments[0] : {},
            t = e.ak,
            r = e.sk,
            i = e.method,
            o = e.url,
            d = e.body,
            s = n(),
            c = a({
                method: i,
                url: o,
                ak: t,
                sk: r,
                date: s
            }),
            l = u(d, r),
            m = {
                "X-HMAC-SIGNATURE": c,
                "X-HMAC-ACCESS-KEY": t,
                "X-HMAC-ALGORITHM": "hmac-sha256",
                "X-HMAC-DIGEST": l,
                "X-HMAC-Date": s
            };
        return m
    };


    console.log(moment())

    function n() {
        // var e = 0,
        //     t = wx.getStorageSync("serverBetweenTime");
        // t && (e = new Number(t));
         var n = (new Date).getTime() + 25000;
        return (0, r.default)(n).utc().format("ddd, DD MMM YYYY HH:mm:ss [GMT]")
        //return "Fri, 18 Aug 2023 06:24:46 GMT";
       // return "Fri, 18 Aug 2023 07:25:45 GMT";
    }

    function a() {
        var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
            r = e.method,
            n = e.url,
            a = e.ak,
            u = e.sk,
            i = e.date,
            o = r + "\n" + n + "\n\n" + a + "\n" + i + "\n",
            d = t.default.HmacSHA256(o, u);
        return d = t.default.enc.Base64.stringify(d)
    }

    function u(e, r) {
        var n = t.default.HmacSHA256(e, r);
        console.log(t.default.enc.Base64.stringify(n));
        return n = t.default.enc.Base64.stringify(n)
    }
</script>